Skip to content

fix(antigravity): drop messages whose parts become empty after thought filtering - #3366

Open
Lucifer07 wants to merge 1 commit into
decolua:masterfrom
Lucifer07:fix/antigravity-drop-empty-parts
Open

fix(antigravity): drop messages whose parts become empty after thought filtering#3366
Lucifer07 wants to merge 1 commit into
decolua:masterfrom
Lucifer07:fix/antigravity-drop-empty-parts

Conversation

@Lucifer07

Copy link
Copy Markdown

Problem

When an assistant message contains only reasoning/thought parts (no text, no tool calls), the part filter in open-sse/executors/antigravity.js strips every part, leaving parts: []. The Antigravity/Gemini API rejects this with HTTP 400 INVALID_ARGUMENT ("Request contains an invalid argument."), breaking long agent conversations that include thinking-only turns.

Fix

Filter out messages whose parts become empty after the thought-part filtering, so no empty-parts message is sent upstream.

}).filter(c => c.parts?.length > 0);

Verification

Reproduced the exact 400 through a live router, then confirmed the fix returns 200 with a valid stream for: thinking-only assistant turns, normal requests, and tool-call histories.

…t filtering

When an assistant message contains only reasoning/thought parts (no text,
no tool calls), the part filter strips every part, leaving parts: []. The
Antigravity/Gemini API rejects this with HTTP 400 INVALID_ARGUMENT
("Request contains an invalid argument."), breaking long agent
conversations that include thinking-only turns.

Filter out such messages after mapping contents so no empty-parts message
is sent upstream.
afandiaziz added a commit to afandiaziz/9router that referenced this pull request Aug 20, 2026
afandiaziz added a commit to afandiaziz/9router that referenced this pull request Aug 20, 2026
…/security/providers

Verified via trial-merge + per-PR tests (84 pass/0 fail), OAuth baseline
identical, providers baseline additive-only (+reasonix/ovh/joycode/openmodel).

PRs: decolua#3411 decolua#3370 decolua#3369 decolua#3368 decolua#3393 decolua#3366 decolua#3395 decolua#3382 decolua#3359 decolua#3408 decolua#3357
     decolua#3379 decolua#3380 decolua#3381 decolua#3396 decolua#3338

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant